﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="SearchIssues.aspx.cs" Inherits="CustomerService.ReportIssues.SearchIssues" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 122px;
        }
        .style2
        {
            width: 154px;
        }
        .style4
        {
            width: 157px;
        }
        .style5
        {
            width: 107px;
        }
        .style6
        {
            width: 104px;
        }
    </style>
    <script src="../Jquery/calendar.js" type="text/javascript"></script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table class="issue">
        <tr>
            <td class="style1">
                标题
            </td>
            <td colspan="5">
                <asp:TextBox ID="txtIssueTitle" runat="server" Width="508px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                问题编号
            </td>
            <td class="style2">
                <asp:TextBox ID="txtId" runat="server"></asp:TextBox>
            </td>
            <td class="style6">
                GSID
            </td>
            <td colspan="3">
                <asp:TextBox ID="txtGSID" runat="server" Width="427px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                问题等级
            </td>
            <td class="style2">
                <asp:DropDownList ID="dropIssueLevel" runat="server" DataSourceID="SqlDataSource1"
                    DataTextField="IssueLevelID" DataValueField="IssueLevelID" AppendDataBoundItems="true">
                    <asp:ListItem Text="请选择" Value="-1" Selected="True"></asp:ListItem>
                </asp:DropDownList>
            </td>
            <td class="style6">
                问题分类
            </td>
            <td class="style4">
                <asp:DropDownList ID="dropIssueCategory" runat="server" DataSourceID="SqlDataSource3"
                    DataTextField="IssueCategoryName" DataValueField="IssueCategoryID" AppendDataBoundItems="true">
                    <asp:ListItem Text="请选择" Value="-1" Selected="True"></asp:ListItem>
                </asp:DropDownList>
            </td>
            <td class="style5">
                问题来源
            </td>
            <td>
                <asp:DropDownList ID="dropIssueSource" runat="server" DataSourceID="SqlDataSource2"
                    DataTextField="IssueSourceName" DataValueField="IssueSourceID" AppendDataBoundItems="true">
                    <asp:ListItem Text="请选择" Value="-1" Selected="True"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="style1">
                客户端版本
            </td>
            <td class="style2">
                <asp:DropDownList ID="dropClientVersion" runat="server" DataSourceID="SqlDataSource4"
                    DataTextField="ClientVersionValue" DataValueField="ClientVersionID" AppendDataBoundItems="true">
                    <asp:ListItem Text="请选择" Value="-1" Selected="True"></asp:ListItem>
                </asp:DropDownList>
            </td>
            <td class="style6">
                客户QQ
            </td>
            <td class="style4">
                <asp:TextBox ID="txtCustomersQQ" runat="server"></asp:TextBox>
            </td>
            <td class="style5">
                客户电话
            </td>
            <td>
                <asp:TextBox ID="txtCustomersMobile" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style1">
                客户姓名
            </td>
            <td class="style2">
                <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox>
            </td>
            <td class="style6">
                云游戏帐号
            </td>
            <td class="style4">
                <asp:TextBox ID="txtUserAccounts" runat="server"></asp:TextBox>
            </td>
            <td class="style5">
                用户带宽
            </td>
            <td>
                <asp:DropDownList ID="dropOperators" runat="server" DataSourceID="SqlDataSource11"
                    DataTextField="OperatorsName" DataValueField="OperatorsID" AppendDataBoundItems="true">
                    <asp:ListItem Text="请选择" Value="-1" Selected="True"></asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="dropBandWidth" runat="server" DataSourceID="SqlDataSource8"
                    DataTextField="BandWidthValue" DataValueField="BandWidthID" AppendDataBoundItems="true">
                    <asp:ListItem Text="请选择" Value="-1" Selected="True"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="style1">
                服务区
            </td>
            <td class="style2">
                <asp:DropDownList ID="dropServiceArea" runat="server" DataSourceID="SqlDataSource5"
                    DataTextField="ServiceAreaName" DataValueField="ServiceAreaID" AppendDataBoundItems="true">
                    <asp:ListItem Text="请选择" Value="-1" Selected="True"></asp:ListItem>
                </asp:DropDownList>
            </td>
            <td class="style6">
                地区
            </td>
            <td class="style4">
                <asp:TextBox ID="txtRegion" runat="server"></asp:TextBox>
            </td>
            <td class="style5">
                负责人
            </td>
            <td>
                <asp:DropDownList ID="dropPrincipal" runat="server" DataSourceID="SqlDataSource17"
                    DataTextField="EmployeeName" DataValueField="EmployeeID" AppendDataBoundItems="true">
                    <asp:ListItem Text="请选择" Value="-1" Selected="True"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="style1">
                操作系统
            </td>
            <td class="style2">
                <asp:DropDownList ID="dropSystemEnvironment" runat="server" DataSourceID="SqlDataSource9"
                    DataTextField="SystemEnvironmentValue" DataValueField="SystemEnvironmentID" AppendDataBoundItems="true">
                    <asp:ListItem Text="请选择" Value="-1" Selected="True"></asp:ListItem>
                </asp:DropDownList>
            </td>
            <td class="style6">
                实测码率
            </td>
            <td class="style4">
                <asp:TextBox ID="txtDecodingRate" runat="server"></asp:TextBox>
            </td>
            <td class="style5">
                状态
            </td>
            <td>
                <asp:DropDownList ID="dropState" runat="server" DataSourceID="SqlDataSource10" DataTextField="State"
                    DataValueField="WFID" AppendDataBoundItems="true">
                    <asp:ListItem Text="请选择" Value="-1" Selected="True"></asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="style1">
                创建人
            </td>
            <td class="style2">
                <asp:TextBox ID="txtCreateUser" runat="server"></asp:TextBox>
            </td>
            <td class="style6">
                创建开始时间
            </td>
            <td class="style4">
                <asp:TextBox ID="txtStartTime" runat="server" onFocus="calendar();"></asp:TextBox>
            </td>
            <td class="style5">
                创建结束时间
            </td>
            <td>
                <asp:TextBox ID="txtEndTime" runat="server"  onFocus="calendar();"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="Button1" runat="server" Text="搜索" OnClick="Button1_Click" />
                <asp:Label ID="labError" runat="server" ForeColor="Red"></asp:Label>
            </td>
        </tr>
    </table>
    <div style="text-align: center;">
        <div>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="commongv">
                <Columns>
                    <asp:TemplateField HeaderText="问题等级" SortExpression="IssueLevel">
                        <ItemTemplate>
                            <%# Eval("IssueLevel")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="问题编号 " SortExpression="Region">
                        <ItemTemplate>
                            <%# Eval("Id")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="问题分类" SortExpression="IssueCategory">
                        <ItemTemplate>
                            <%# Eval("IssueCategory")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="服务区" SortExpression="ServiceArea">
                        <ItemTemplate>
                            <%# Eval("ServiceArea")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="标题" SortExpression="IssueTitle">
                        <ItemTemplate>
                            <%# Eval("IssueTitle")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="当前环节耗时" SortExpression="IssueTitle">
                        <ItemTemplate>
                            <%# new Koonsoft.CustomerService.BLL.WFBLL().GetWfById(int.Parse(Eval("Status").ToString())).State != "已回访" 
                                ? ((DateTime.Now - DateTime.Parse(Eval("LastTime").ToString())).TotalMinutes / 60.0).ToString("0.0") + "小时" : "已结束"%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="状态" SortExpression="Status">
                        <ItemTemplate>
                            <%# new Koonsoft.CustomerService.BLL.WFBLL().GetWfById(int.Parse(Eval("Status").ToString())).State%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="创建时间" SortExpression="Status">
                        <ItemTemplate>
                            <%# DateTime.Parse(Eval("ExceptionTime").ToString()).ToString("yyyy-MM-dd HH:mm")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="负责人" SortExpression="IssueTitle">
                        <ItemTemplate>
                            <%# Eval("Principalid")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="提交人" SortExpression="IssueTitle">
                        <ItemTemplate>
                            <%# Eval("CreateUser")%>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="查看" SortExpression="IssueID">
                        <ItemTemplate>
                            <a href='../issues/Issue.aspx?Guid=<%#Server.UrlEncode(Eval("IssueID").ToString())%>'>
                                查看</a>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <webdiyer:AspNetPager ID="AspNetPager1" runat="server" PageSize="12" AlwaysShow="True"
                OnPageChanged="AspNetPager1_PageChanged" ShowCustomInfoSection="Left" CustomInfoSectionWidth="35%"
                ShowPageIndexBox="always" PageIndexBoxType="DropDownList" CustomInfoHTML="第<font color='red'><b>%currentPageIndex%</b></font>页，共%PageCount%页，每页显示%PageSize%条记录"
                Visible="false">
            </webdiyer:AspNetPager>
        </div>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CustomerService %>"
            SelectCommand="SELECT * FROM [IssueLevel]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:CustomerService %>"
            SelectCommand="SELECT * FROM [IssueSource]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:CustomerService %>"
            SelectCommand="GetIssuecategories" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:CustomerService %>"
            SelectCommand="SELECT * FROM [ClientVersion]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource8" runat="server" ConnectionString="<%$ ConnectionStrings:CustomerService %>"
            SelectCommand="SELECT * FROM [BandWidth]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource7" runat="server" ConnectionString="<%$ ConnectionStrings:CustomerService %>"
            SelectCommand="SELECT * FROM [Region]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:CustomerService %>"
            SelectCommand="SELECT * FROM [ServiceArea]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource6" runat="server" ConnectionString="<%$ ConnectionStrings:CustomerService %>"
            SelectCommand="SELECT * FROM [Region]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource9" runat="server" ConnectionString="<%$ ConnectionStrings:CustomerService %>"
            SelectCommand="SELECT * FROM [SystemEnvironment]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource10" runat="server" ConnectionString="<%$ ConnectionStrings:CustomerService %>"
            SelectCommand="SELECT * FROM [wf]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource11" runat="server" ConnectionString="<%$ ConnectionStrings:CustomerService %>"
            SelectCommand="SELECT * FROM [Operators]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource17" runat="server" ConnectionString="<%$ ConnectionStrings:CustomerService %>"
            SelectCommand="SELECT * FROM [Employees] WHERE ([IsPrincipal] = @IsPrincipal)">
            <SelectParameters>
                <asp:Parameter DefaultValue="true" Name="IsPrincipal" Type="Boolean" />
            </SelectParameters>
        </asp:SqlDataSource>
    </div>
</asp:Content>
